package cn.buk.tms.eotms.report.dto;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 日统计
 *
 * @author yfdai
 */
public class ReportStatDailyDto {

	/**
	 * 日期
	 */
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date opDate;

	/**
	 * 销售金额
	 */
	private double totalAmount;


	private double preProcessDouble(double val) {
		BigDecimal bd = BigDecimal.valueOf(val);
		bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP);

		return bd.doubleValue();
	}

	public double getTotalAmount() {
		return totalAmount;
	}

	public void setTotalAmount(double totalAmount) {
		this.totalAmount = preProcessDouble(totalAmount);
	}

	public Date getOpDate() {
		return opDate;
	}

	public void setOpDate(Date opDate) {
		this.opDate = opDate;
	}
}
